/**
 * 
 */
package cn.haona.game.simb.object.logic;

import cn.haona.game.simb.logic.LogicImpl;
import cn.haona.game.simb.object.Cell;
import cn.haona.game.simb.object.god.EntityManager;
import cn.haona.game.simb.object.god.MainManager;
import cn.haona.reflect.ReflectionBasic;

/**
 * 状态机
 * 
 * @author Administrator
 * 
 */
public abstract class StateMachine extends LogicImpl {

	public StateMachine(Cell host) {
		super(host);
	}

	/**
	 * 生成出状态机
	 * 
	 * @param className
	 * @param host
	 * @return
	 */
	public static StateMachine createStateMachine(String className, Cell host) {
		try {
			StateMachine stateMachine=(StateMachine)ReflectionBasic.newInstance(className, new Object[]{host});
			return stateMachine;
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return null;
	}

	/**
	 * 进入之前
	 * @param param TODO
	 * 
	 * @return
	 */
	public abstract Object preEntrance(Object param);

	/**
	 * 进入
	 * @param param TODO
	 * 
	 * @return
	 */
	public abstract Object entrance(Object param);

}
